package com.ruoyi.business.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 请假信息-有效状态
 *
 * @author Tellsea
 * @date 2024/1/16
 */
@Getter
@AllArgsConstructor
public enum LeaveEffectiveStatusEnums {

    NORMAL(1L, "正常"),
    CLOSE(2L, "已销假"),
    DELETE(3L, "已删除"),
    ;

    private final Long code;
    private final String name;

    public static String getNameByCode(Long code) {
        for (LeaveEffectiveStatusEnums enums : LeaveEffectiveStatusEnums.values()) {
            if (enums.getCode().equals(code)) {
                return enums.getName();
            }
        }
        return "";
    }
}
